package com.leonardo.persistenceme.utils;

import java.util.Vector;

import MAR.Core.Field;

public class VectorUtils {

	public static void sortFieldsVector(Vector vec) {
		int size = vec.size();
		for(int i = 0; i < size - 1; i++) {
			String name_i = ((Field) vec.elementAt(i)).getName();
			for(int j = i + 1; j < size; j++) {
				String name_j = ((Field) vec.elementAt(j)).getName();
				if(name_i.compareTo(name_j) > 0) {
					Field aux = (Field) vec.elementAt(i);
					vec.insertElementAt(vec.elementAt(j), i);
					vec.insertElementAt(aux, j);
				}
			}
		}
	}
	
}
